#include <iostream>
#include "s-clique_free.cpp"
#include "IO.cpp"
#include <vector>
#include <boost/dynamic_bitset.hpp>
#include <string>

using namespace std;
using namespace boost;

int main(int argc, char** argv)
{

    if(argc != 6) {
        cout<<"Usage: ./filename 'graph_name' 'checkpoint' 's' - int 'k' - int 'index' - int"<<endl;
        return 0;
    }

    string filename( argv[1] );
    string checkpoint(argv[2]);
    int s = atoi(argv[3]);
    int k = atoi(argv[4]);
    int index = atoi(argv[5]);
    cout<<"s: "<<s<<endl;
    cout<<"k: "<<k<<endl;
    cout<<"i: "<<index<<endl;

    if(s < 2) {
        cout<<"s must be a positive integer, and bigger than 1!"<<endl;
        return 0;
    }

    vector<dynamic_bitset<> > graph;
    int nodes, edges;

    readgraph_bitset(filename, graph, nodes, edges);
    vector<pair<int, int> > edges_to_delete;
    vector<pair<int, int> > deleted_edges;
    vector<dynamic_bitset<> > quasi_colors;
    loadcheckpoint(quasi_colors, edges_to_delete, deleted_edges, checkpoint, s, nodes, k);
    dynamic_bitset<> edge(nodes);
    edge = graph[edges_to_delete[index].first] & graph[edges_to_delete[index].second];

    vector<dynamic_bitset<> > stretched_graph = stretch_graph(graph, edge);

    cout<<(k_clique(stretched_graph, k-2) ? "van" : "nincs")<<endl;

    return 0;
}
